package com.fs.ibox.dao.impl;

import com.fs.ibox.dao.BoticeDao;
import com.fs.ibox.pojo.Botice;
import com.fs.ibox.util.JDBCUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * Author:HOU
 * date:2022/11/22  15:06
 * 案例:
 **/
public class BoticeDaoimpl implements BoticeDao {
    @Override
    public List<Botice> qAll(int i) {
        String sql="";
        if (i==4){
             sql="SELECT * FROM tb_botice ORDER BY b_time desc";
            List<Botice> botices = JDBCUtil.executeQuery(sql, Botice.class);
            return botices;
        }
        else {
            sql="SELECT * FROM tb_botice where b_type=? ORDER BY b_time desc";
            List<Botice> botices = JDBCUtil.executeQuery(sql, Botice.class, i);
            return botices;
        }
//        List<Botice> botices = JDBCUtil.executeQuery(sql, Botice.class, i);

    }
}
